package connect;

import org.apache.mina.core.session.IoSession;

import util.ByteBuffer;
import app.App;

public class Transmitter {
	public static void sendToClient(int sessionId, ByteBuffer data)
    {
		IoSession session = App.getInstance().connects.get(sessionId);

		session.write(data);
	
    }
//	
	public static void sendToOthers(int sessionId,ByteBuffer data)
	{
		for(IoSession session :App.getInstance().connects.values())
		{
			if(session.hashCode() == sessionId)
			{
				continue;
			}
			session.write(data);
			
		}
	}
}
